
import { PageHeaderWrapper, GridContent } from '@ant-design/pro-layout';
import style from './index.less';
import indexStyle from '@/pages/index.less';
import Nav from './components/Nav';
import NewArticlePage from './components/NewArticle';
import Comments from './components/Comments'
import  Footer from '@/components/Footer'
export default function IndexPage() {
  const any:any = localStorage.getItem('user')
  const user = JSON.parse(any);
  return (
    <div>
      <PageHeaderWrapper
        className={style.header}
        fixedHeader={true}
        content={
          <div>
            <h1 className={style.title}>您好，{user.name}</h1>
            <p>您的角色: {
                 user.role=== 'visitor'? '访客':'管理员'
              }

            </p>
          </div>
        }
      ></PageHeaderWrapper>

      <main className={indexStyle.p20}>
        <GridContent>
          {/* 快速导航 */}
          <Nav />
          {/* 最新文章 */}
          <NewArticlePage />
          {/* 评论 */}
          <Comments />
        </GridContent>
      </main>

      <Footer/>
    </div>
  );
}
